#if !defined(_ASTRING_H_)
#define _ASTRING_H_

#include "AObject.h"

class CAStringUtils
{
public:
	static bool startWith(const CAString& str, const char* with);
	static int split(const CAString& src, const char* token, strings& results, bool excludeZeroLen = true);
	static bool equal_nc(const CAString& a, const CAString& b);
	static void replace(CAString& str, const CAString &strsrc, const CAString &strdst);
	static unsigned int hash(const char* str);

	static void buildTempName(CAString& name, const char* prefix);

	static bool toFloats(const CAString& src, float* pfloats, int count);

	static bool toColor(const CAString& src, unsigned int& color);
	static bool toBool(const CAString& src, bool& result);
	static bool toInt(const CAString& src, int& result);
	static bool toFloat(const CAString& src, float& result);
	static bool toPoint(const CAString& src, CCPoint& result);
	static bool toPoint3(const CAString& src, float& x, float& y, float& z);
	static bool toSize(const CAString& src, CCSize& result);
	static bool toRect(const CAString& src, CCRect& result);
};

#endif //_ASTRING_H_